extends layout

block content
  div#build
    el-card
      el-page-header(@back="goBack()" content="#{title}")
    el-card(class="m-t-10")
      el-button(type="primary" icon="el-icon-plus" @click="showDialog()") 新增
      el-table(v-bind:data="#{JSON.stringify(list)}" border class="m-t-10")
        el-table-column(prop="id" label="#")
        el-table-column(prop="name" label="名字")
        el-table-column(prop="createYear" label="建造年度")
        el-table-column(prop="remark" label="备注")
        el-table-column(prop="actions" label="操作")
    el-dialog(v-bind:visible.sync="dialog", v-bind:center="true", title="新增")
      div 
        el-form(ref="ruleForm" size="mini" label-width="80px" v-bind:model="editForm" v-bind:rules="roleRules")
          el-form-item(label="名字" prop="name")
            el-input(v-model="editForm.name")
          el-form-item(label="建造年度" prop="createYear")
            el-input(v-model="editForm.createYear")
          el-form-item(label="备注" prop="remark")
            el-input(v-model="editForm.remark")
          el-form-item(label="图片上传")
            el-upload(action="/upload/" v-bind:limit="1" list-type="picture-card" v-bind:on-success="handleSuccess" v-bind:on-preview="handlePictureCardPreview" v-bind:on-remove="handleRemove")
              i(class="el-icon-plus")
            el-dialog(v-bind:visible.sync="dialogVisible" append-to-body)
              img(width="100%" v-bind:src="dialogImageUrl" alt="")
      div(slot="footer")
        el-button(type="primary" @click="onSave()") 保存
        el-button(@click="showDialog()") 取消
    script(src="/javascripts/view/build.js")

